<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import YesNoEnum from '@/infra/constant/YesNoEnum'
import { preferenceAreaApi } from '@/feature/pdt/infra/api/preferenceAreaApi'
import CURDTable from '@/framework/components/table/CURDTable'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: preferenceAreaApi,
        columns: [
          {
            label: '标题',
            searchable: true,
            width: 'auto',
            required: true,
            prop: 'title'
          },
          {
            label: '专区副标题',
            prop: 'subTitle'
          },
          {
            label: '排序',
            prop: 'sortNum',
            type: ColumnType.NUMBER
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '封面',
            prop: 'cover'
          },
          {
            label: '专区类型',
            prop: 'preferenceType',
            type: ColumnType.NUMBER
          },
          {
            label: '是否固定的记录，固定的无法删除',
            prop: 'fixedFlag',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

